package com.xiyi.shouxin.entity.user.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.user.LoginLog;

public class LoginLogMapper implements RowMapper<LoginLog> {
    @Override
    @Nullable
    public LoginLog mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        LoginLog log = new LoginLog();
        if (rs == null) {
            return log;
        }
        log.setId(rs.getLong("id"));
        log.setUserId(rs.getLong("user_id"));
        log.setDeviceId(rs.getLong("device_id"));
        log.setCreatedAt(rs.getTimestamp("created_at"));
        return log;
    }
}
